package com.acol.estagio.workflow.services.util;

import org.apache.log4j.Logger;

import com.acol.estagio.workflow.interfaces.Campeonato;
import com.acol.estagio.workflow.interfaces.CampeonatoHome;
import com.acol.estagio.workflow.interfaces.FluxoProcesso;
import com.acol.estagio.workflow.interfaces.FluxoProcessoHome;
import com.acol.exception.SystemException;
import com.acol.services.EJBHomeFactory;

public class EstagioServices {
	private static Logger logger = Logger.getLogger(EstagioServices.class);
	
	private EstagioServices() {}
	
	public static FluxoProcesso getFluxoProcessoBean() throws SystemException {
		try {
			FluxoProcessoHome home = (FluxoProcessoHome) EJBHomeFactory.getInstance().lookUpHome(FluxoProcessoHome.class, FluxoProcessoHome.COMP_NAME);
			return home.create();
		} catch (Exception e) {
			logger.fatal("Erro em EstagioServices.getFluxoProcessoBean()", e);
			throw new SystemException (e);
		}
	}
	public static Campeonato getCampeonatoBean() throws SystemException {
		try {
			CampeonatoHome home = (CampeonatoHome) EJBHomeFactory.getInstance().lookUpHome(CampeonatoHome.class, CampeonatoHome.COMP_NAME);
			return home.create();
		} catch (Exception e) {
			logger.fatal("Erro em EstagioServices.getCampeonatoBean()", e);
			throw new SystemException (e);
		}
	}
}
